<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Test3</title>
</head>
<body>
<form action="" method="post">
    用户名：　<input type="text" id="username"><br>
    密码：　　<input type="password" id="pwd"><br>
    确认密码：<input type="password" id="pdw2"><br>
    
    <input type="button" name="submit1" value="提交" onclick="submit2()">
    <input type="reset" name="submit2" value="重置">
    <input type="button" name="submit3" value="关闭" onclick="close2()">
</form>

<script>
    function submit2() {
        alert("响应");
        var type=confirm("确定要提交吗?");
    }

    function close2() {
        alert("相应");
        var type=confirm("确定要关闭吗?");
        if(type==true){
            window.close();
        }
    }
</script>
</body>
</html>